/*
* This file is a part of the open-eBackup project.
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
* If a copy of the MPL was not distributed with this file, You can obtain one at
* http://mozilla.org/MPL/2.0/.
*
* Copyright (c) [2024] Huawei Technologies Co.,Ltd.
*
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
*/
package openbackup.data.protection.access.provider.sdk.copy;

import openbackup.data.protection.access.provider.sdk.base.DataProtectionProvider;
import openbackup.data.protection.access.provider.sdk.exception.NotImplementedException;

import java.util.Collections;
import java.util.List;

/**
 * 功能描述
 *
 */
public interface CopyProvider extends DataProtectionProvider<CopyBo> {
    /**
     * This method is used for delete the copy according to retention policy.
     *
     * @param requestId requestId
     * @param copy copy info
     */
    void deleteCopy(String requestId, CopyInfoBo copy);

    /**
     * This method is used for build copy info
     *
     * @param requestId unique uuid throughout in one backup process
     * @param backupId  The copy ID generated by the backup task
     * @param instanceId  The copy ID generated by the backup task
     * @return 副本信息
     */
    default CopyInfoBo buildCopy(String requestId, String backupId, String instanceId) {
        throw new NotImplementedException("Not Implemented Exception");
    }

    /**
     * This method is used for build copy info
     *
     * @param requestId unique uuid throughout in one backup process
     * @param backupId The copy ID generated by the backup task
     * @param instanceId The copy ID generated by the backup task
     * @param subType 副本对应的资源子类型
     * @return 副本信息
     */
    default List<CopyInfoBo> buildCopy(String requestId, String backupId, String instanceId, String subType) {
        return Collections.singletonList(buildCopy(requestId, backupId, instanceId));
    }
}
